﻿using System;
using Castle.ActiveRecord;
using CosyTrade.Data;

namespace CosyTrade.Futures
{
    /// <summary>
    /// 商品
    /// </summary>
    [AddPropertyChangedNotifyInterface, PropertyChangedNotify]
    [ActiveRecord("tbWaresInfo"), Serializable]
    public class Wares 
    {
        private readonly Guid primaryKey = Guid.NewGuid();
        [PrimaryKey(PrimaryKeyType.Assigned, "ROWGUID", Access = PropertyAccess.NosetterCamelcase)]
        public Guid PrimaryKey
        {
            get { return primaryKey; }
        }

        /// <summary>
        /// 商品编号
        /// </summary>
        private string waresCode;
        /// <summary>
        /// 条形码
        /// </summary>
        private string barCode;
        /// <summary>
        /// 中文名称
        /// </summary>
        private string chineseName;
        /// <summary>
        /// 西文名称
        /// </summary>
        private string englishName;
        /// <summary>
        /// 商品分类
        /// </summary>
        private WaresCategory waresCategory;
        /// <summary>
        /// 规格型号
        /// </summary>
        private string speces;
        /// <summary>
        /// 材料质地
        /// </summary>
        private string material;
        /// <summary>
        /// 厂家型号
        /// </summary>
        private string factorySpeces;
        /// <summary>
        /// 毛重(千克)
        /// </summary>
        private double netWeight;
        /// <summary>
        /// 体积(M2)
        /// </summary>
        private double volume;
        /// <summary>
        /// 长(M)
        /// </summary>
        private double wareLong;
        /// <summary>
        /// 宽(M)
        /// </summary>
        private double wdith;
        /// <summary>
        /// 高(M)
        /// </summary>
        private double height;
        /// <summary>
        /// 产品说明
        /// </summary>
        private string wareMemo;
        /// <summary>
        /// 产品图片
        /// </summary>
        private string imagePath;

        /// <summary>
        /// 商品编号
        /// </summary>
        [Property]
        public string WaresCode
        {
            get { return waresCode; }
            set { waresCode = value; }
        }

        /// <summary>
        /// 条形码
        /// </summary>
        [Property]
        public string BarCode
        {
            get { return barCode; }
            set { barCode = value; }
        }

        /// <summary>
        /// 中文名称
        /// </summary>
        [Property]
        public string ChineseName
        {
            get { return chineseName; }
            set { chineseName = value; }
        }

        /// <summary>
        /// 西文名称
        /// </summary>
        [Property]
        public string EnglishName
        {
            get { return englishName; }
            set { englishName = value; }
        }

        /// <summary>
        /// 商品分类
        /// </summary>
        [BelongsTo]
        public WaresCategory WaresCategory
        {
            get { return waresCategory; }
            set { waresCategory = value; }
        }

        /// <summary>
        /// 规格型号
        /// </summary>
        [Property]
        public string Speces
        {
            get { return speces; }
            set { speces = value; }
        }

        /// <summary>
        /// 材料质地
        /// </summary>
        [Property]
        public string Material
        {
            get { return material; }
            set { material = value; }
        }

        /// <summary>
        /// 厂家型号
        /// </summary>
        [Property]
        public string FactorySpeces
        {
            get { return factorySpeces; }
            set { factorySpeces = value; }
        }

        /// <summary>
        /// 毛重(千克)
        /// </summary>
        [Property]
        public double NetWeight
        {
            get { return netWeight; }
            set { netWeight = value; }
        }

        /// <summary>
        /// 体积(M2)
        /// </summary>
        [Property]
        public double Volume
        {
            get { return volume; }
            set { volume = value; }
        }

        /// <summary>
        /// 长(M)
        /// </summary>
        [Property]
        public double WareLong
        {
            get { return wareLong; }
            set { wareLong = value; }
        }

        /// <summary>
        /// 宽(M)
        /// </summary>
        [Property]
        public double Wdith
        {
            get { return wdith; }
            set { wdith = value; }
        }

        /// <summary>
        /// 高(M)
        /// </summary>
        [Property]
        public double Height
        {
            get { return height; }
            set { height = value; }
        }

        /// <summary>
        /// 产品说明
        /// </summary>
        [Property]
        public string WareMemo
        {
            get { return wareMemo; }
            set { wareMemo = value; }
        }

        /// <summary>
        /// 产品图片
        /// </summary>
        [Property]
        public string ImagePath
        {
            get { return imagePath; }
            set { imagePath = value; }
        }

        #region 库存信息
        ///// <summary>
        ///// 
        ///// </summary>
        //private int storeCount;
        //private Department mapDepartment;

        ///// <summary>
        ///// 所属分公司
        ///// </summary>
        //public Department MapDepartment
        //{
        //    get { return mapDepartment; }
        //    set { mapDepartment = value; }
        //}

        ///// <summary>
        ///// 库存数量
        ///// </summary>
        //public int StoreCount
        //{
        //    get { return storeCount; }
        //    set { storeCount = value; }
        //}

        #endregion
    }
}